package com.ehotting.mqbd.api.enums;

import java.util.Arrays;

public enum SolveStepEnum {
    ONE("one","单步处理"),MULTI("multi","多步处理");

    private String code;
    private String name;

    SolveStepEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public static SolveStepEnum fromCode(String alias) {
        return Arrays.stream(values())
                .filter(type -> alias.equals(type.getCode()))
                .findAny()
                .orElse(null);
    }
}
